Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 3.12 examples from the typing preview #438

Merged
merged 9 commits into from
Sep 25, 2023
Merged

Conversation

gahjelle
Copy link
Contributor

Where to put new files:

  • New files should go into a top-level subfolder, named after the article slug. For example: my-awesome-article

How to merge your changes:

  1. Make sure the CI code style tests all pass (+ run the automatic code formatter if necessary).
  2. Find an RP Team member on Slack and ask them to review & approve your PR.
  3. Once the PR has one positive ("approved") review, GitHub lets you merge the PR.
  4. 🎉

@gahjelle gahjelle requested a review from bzaczynski September 20, 2023 06:57
@gahjelle
Copy link
Contributor Author

I see that the linters are crashing on the new type variable syntax. I'll investigate whether we can update linters, or if we should do what Leodanis did for the f-strings, and provide the new syntax within comments.

@@ -136,6 +138,37 @@ Pythonista!

In this example, you can see how the new implementation of f-strings allows you to include backslashes in embedded expressions. This wasn't possible with f-strings in earlier versions of Python.

### Static Typing Improvements

You'll find all static typing examples inside the [`typing/`](typing/) directory. You should install the Pyright type checker for PyPI:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✍️ Typo

Should this be from instead of for? 🤔

Suggested change
You'll find all static typing examples inside the [`typing/`](typing/) directory. You should install the Pyright type checker for PyPI:
You'll find all static typing examples inside the [`typing/`](typing/) directory. You should install the Pyright type checker from PyPI:

Comment on lines 155 to 160
- [`generic_queue.py`](typing/generic_queue.py) and [`generic_queue_311.py`](typing/generic_queue_311.py)
- [`list_helpers.py`](typing/list_helpers.py) and [`list_helpers_311.py`](typing/list_helpers_311.py)
- [`concatenation.py`](typing/concatenation.py) and [`concatenation_311.py`](typing/concatenation_311.py)
- [`inspect_string.py`](typing/inspect_string.py) and [`inspect_string_311.py`](typing/inspect_string_311.py)
- [`deck.py`](typing/deck.py) and [`deck_311.py`](typing/deck_311.py)
- [`alias.py`](typing/alias.py) and [`alias_311.py`](typing/alias_311.py)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Fact Check

Missing files? I'm not seeing the *_311.py files in this pull request.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry. I had updated the README to remove these links after I combined the 3.11 and 3.12, but the README wasn't committed. Should be fixed now.

Copy link
Contributor

@bzaczynski bzaczynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gahjelle LGTM!

@gahjelle gahjelle merged commit e06ae43 into master Sep 25, 2023
1 check passed
@gahjelle gahjelle deleted the gahjelle-python312-typing branch September 25, 2023 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants